Skip to content

[Fusion] Add onError to source schema capabilities#9608

Merged
tobias-tengler merged 2 commits intomainfrom
tte/add-onerror-capability
Apr 28, 2026
Merged

[Fusion] Add onError to source schema capabilities#9608
tobias-tengler merged 2 commits intomainfrom
tte/add-onerror-capability

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 28, 2026 07:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an onError capability for source schemas and propagates it through configuration parsing into downstream subgraph requests (HTTP and in-memory connectors), alongside a broader rename of HTTP source schema client/configuration types.

Changes:

  • Parse capabilities.onError from source schema transport settings and store it on the source schema client configuration.
  • Forward configured onError into outgoing subgraph requests (HTTP transport and in-memory connector) and snapshot serialization.
  • Update/rename HTTP source schema client/configuration types and adjust tests/snapshots accordingly.

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/FusionRequestExecutorManagerTests.cs Updates assertions to the renamed HTTP configuration type.
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Configuration/ParsersTests.cs Removes the old combined parser tests (superseded by a dedicated test class).
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Configuration/HttpSourceSchemaClientConfigurationParserTests.cs Adds/extends parser test coverage including onError parsing behavior.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/SourceSchemaErrorTests.OnError_SchemaDefault_Null_AppliesWithoutPerRequestOverride.yaml Aligns snapshot title with renamed test.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/snapshots/SourceSchemaErrorTests.OnError_Null_OnSourceSchema_Forwards_To_Subgraph_Request.yaml New snapshot validating onError is forwarded to subgraph requests.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/SourceSchemaErrorTests.cs Renames a test and adds a new test verifying subgraph onError forwarding.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/FusionTestBase.cs Threads onError through gateway test setup options/config.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/FusionTestBase.MatchSnapshot.cs Writes onError into recorded request snapshots when present.
src/HotChocolate/Fusion/test/Fusion.AspNetCore.Tests/FusionTestBase.CreateSourceSchema.cs Adds onError to source schema test server setup.
src/HotChocolate/Fusion/src/Fusion.Execution/Properties/FusionExecutionResources.resx Renames HTTP client-related resource keys.
src/HotChocolate/Fusion/src/Fusion.Execution/Properties/FusionExecutionResources.Designer.cs Regenerates designer to match renamed resource keys.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/ThrowHelper.cs Updates resource lookups to renamed HTTP client resource keys.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Clients/RequestCallbackState.cs Updates callback state to reference renamed HTTP configuration type.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Clients/HttpSourceSchemaClientFactory.cs Updates factory to use renamed HTTP client/config types.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Clients/HttpSourceSchemaClientConfiguration.cs Adds OnError to HTTP configuration and renames the public configuration type.
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Clients/HttpSourceSchemaClient.cs Forwards config OnError into generated subgraph requests and renames the public client type.
src/HotChocolate/Fusion/src/Fusion.Execution/DependencyInjection/CoreFusionGatewayBuilderExtensions.SourceSchemaClients.cs Adds onError to DI extension APIs and updates them to renamed configuration type.
src/HotChocolate/Fusion/src/Fusion.Execution/Configuration/Parsers/HttpSourceSchemaClientConfigurationParser.cs Parses capabilities.onError and sets it on the produced HTTP configuration.
src/HotChocolate/Fusion/src/Fusion.Connectors.InMemory/InMemorySourceSchemaClientFactory.cs Passes OnError from configuration into the in-memory client.
src/HotChocolate/Fusion/src/Fusion.Connectors.InMemory/InMemorySourceSchemaClientConfiguration.cs Adds OnError to the in-memory client configuration.
src/HotChocolate/Fusion/src/Fusion.Connectors.InMemory/InMemorySourceSchemaClient.cs Applies OnError via errorHandlingMode when building in-memory operation requests.
Files not reviewed (1)
  • src/HotChocolate/Fusion/src/Fusion.Execution/Properties/FusionExecutionResources.Designer.cs: Language not supported
Comments suppressed due to low confidence (3)

src/HotChocolate/Fusion/src/Fusion.Execution/DependencyInjection/CoreFusionGatewayBuilderExtensions.SourceSchemaClients.cs:67

  • AddHttpClientConfiguration is a public extension method, and inserting the new optional onError parameter before the existing optional *AcceptHeaderValues parameters is a source-breaking change for callers that used positional arguments. Consider keeping the old signature (or adding an overload) and adding onError at the end to preserve positional-call compatibility.
    public static IFusionGatewayBuilder AddHttpClientConfiguration(
        this IFusionGatewayBuilder builder,
        string name,
        Uri baseAddress,
        SupportedOperationType supportedOperations = SupportedOperationType.All,
        SourceSchemaClientCapabilities capabilities = SourceSchemaClientCapabilities.All,
        ErrorHandlingMode? onError = null,
        ImmutableArray<MediaTypeWithQualityHeaderValue>? defaultAcceptHeaderValues = null,
        ImmutableArray<MediaTypeWithQualityHeaderValue>? batchingAcceptHeaderValues = null,
        ImmutableArray<MediaTypeWithQualityHeaderValue>? subscriptionAcceptHeaderValues = null,
        Action<OperationPlanContext, ExecutionNode, HttpRequestMessage>? onBeforeSend = null,
        Action<OperationPlanContext, ExecutionNode, HttpResponseMessage>? onAfterReceive = null,
        Action<OperationPlanContext, ExecutionNode, SourceSchemaResult>? onSourceSchemaResult = null)

src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Clients/HttpSourceSchemaClientConfiguration.cs:12

  • Renaming the public configuration type from SourceSchemaHttpClientConfiguration to HttpSourceSchemaClientConfiguration is a breaking change for any external consumers (and similarly for related APIs). If the rename is not intended to be breaking, consider keeping the old type name as an [Obsolete] shim (e.g., deriving from the new type or using type forwarding) to preserve compatibility.
    src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Clients/HttpSourceSchemaClient.cs:22
  • Renaming the public client type from SourceSchemaHttpClient to HttpSourceSchemaClient is a breaking change for consumers that referenced the old type directly. If backward compatibility is desired, consider providing an [Obsolete] wrapper/alias for the old name that forwards to the new implementation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants